package ag.jumpguy;

// y= kx + b
public class Line {
	public float k;
	public float b;
	
	public Vector vector;
	
	public Line(float x1, float y1, float x2, float y2){
		this.vector = new Vector(x1,y1,x2,y2);
		this.k = (y2-y1) / (x2 - x1);
		this.b = y1 - this.k * x1;
	}
	
	public Line(float k, float x, float y){
		this.k = k;
		this.b = y - this.k * x;
	}
	
	public float getX(float y){
		return (y - this.b) / this.k;
	}
	
	public float getY(float x){
		return this.k * x + this.b;
	}
}
